SpatialStream® Code Examples

County Boundaries and Labels

Using SpatialStream® County Boundaries, SLD, and GetMap components, you can access nationwide county boundaries and basic attributes for display in your mapping application. This example will demonstrate how to add county boundaries and county name labels for the entire US (Southern California shown in sample). The SLD (Stylized Layer Descriptor) component allows you to add labels based on attributes in the county boundaries data set and tailor the following display parameters of your county border: boundary color, boundary width, fill color, opacity, label color, and label size. Once the SLD is defined, the GetMap component generates the overlay for your map.

County Boundaries | GetMap | SLD

var county = new Dmp.Layer.WMSLayer("boundary", "SS", {
antiAlias: true
});
county.addChild("countyPoly", "DMP_LICENSE/COUNTY", "$(ACCOUNT_FOLDER)SLD/SimpleBoundary.sld.xml", {
zoomRange: {
min: 5, max: 19
}
});
county.addChild("countyLabel", "DMP_LICENSE/COUNTY", "$(ACCOUNT_FOLDER)SLD/CountyLabel.sld.xml", {
zoomRange: {
min: 7, max: 19
}
});
map.addLayer(county);


Run Sample   View Video   Back To Index